00:00
13:22

Lab: Generative AI for Data Visualization

Estimated time needed: 60 minutes

Overview

In this lab, you will learn how to use generative AI to generate various visuals from the dataset. You will use the Akkio and Columns AI platforms to create multiple charts and graphs automatically using simple steps.

Learning Objectives

After completing this lab, you will be able to:

  • Sign in to Akkio and Columns AI
  • Generate visuals
  • Change the color theme in the chart
  • Generate various charts

Prerequisites

  • Columns AI and Akkio account
  • Basic understanding of exploratory data analysis (EDA)

Note: In Akkio and Columns AI, you can explore few features in the paid or trial version only

About Akkio

Akkio empowers users to harness the power of AI to automate repetitive tasks, including data analysis and visualization. With Akkio's intuitive platform, users can streamline their workflows and generate insights from their data effortlessly.

Using Akkio AI-driven capabilities, users can interact with their data through natural language queries, generating visualizations and actionable insights with ease. By automating these processes, Akkio enables users to focus on strategic decision-making and innovation.

Note: Akkio free trial version is limited to a duration of 15 days

About Columns AI

With Columns AI Natural Language Visualization feature, you can generate charts using descriptions written in plain language. This simplifies and enhances accessibility to data visualization.

Utilizing a natural language interface, users can inquire about their data and receive textual summaries, code snippets, or visual charts as outputs. Leveraging advanced AI models, Columns AI interprets user queries to discern intent and deliver appropriate responses.

Note: While signing up for Columns AI to access the free 7-day trial, users are required to add their bank account details. After the trial period, charges will apply. It is optional to proceed with this Columns AI exercise, and learners can decide if they wish to continue with the sign-up process.

Dataset

In this lab, you will work with two datasets: the Retail Sales Data dataset available on the Akkio platform and the Student Alcohol Consumption dataset student-mat.csv by UCI Machine Learning, which can be obtained from Kaggle for Columns AI.

The Retail Sales Data dataset contains information on retail sales, including various attributes such as Store ID, Employee Number, Area, Date, Sales, Marketing Spend, Electronics Sales, Home Sales, and Clothes Sales. This dataset appears to represent retail sales data, possibly from multiple stores in the same geographic area, over a period of time. Each entry in the dataset corresponds to a single sales transaction, including information about the store, employee, sales amount, and product categories.

Field Description
Store ID Identifier for the store where the sales were made.
Employee Number Identifier for the employee involved in the sales transaction.
Area Geographic area where the store is located.
Date Date of the sales transaction.
Sales Total sales amount for the transaction.
Marketing Spend Amount spent on marketing activities for the transaction.
Electronics Sales Sales amount specifically related to electronics products.
Home Sales Sales amount specifically related to home products.
Clothes Sales Sales amount specifically related to clothing products

The Student Alcohol Consumption dataset is based on data collected from two secondary schools in Portugal, with students enrolled in mathematics and Portuguese courses. The dataset we are using is for the mathematics course. The number of mathematics students involved in the collection was 395. The data collected in locations such as Gabriel Pereira and Mousinho da Silveira includes several pertinence values. Examples of such data are records of demographic information, grades, and alcohol consumption.

Field Description
school GP/MS for the student's school
sex M/F for gender
age 15-22 for the student's age
address U/R for urban or rural, respectively
fam size LE3/GT3 for less than or greater than three family members
Pstatus T/A for living together or apart from parents, respectively
Medu 0 (none) / 1 (primary-4th grade) / 2 (5th - 9th grade) / 3 (secondary) / 4 (higher) for mother's education
Fedu 0 (none) / 1 (primary-4th grade) / 2 (5th - 9th grade) / 3 (secondary) / 4 (higher) for father's education
Mjob 'teacher,' 'health' care related, civil 'services,' 'at_home' or 'other' for the student's mother's job
Fjob 'teacher,' 'health' care related, civil 'services,' 'at_home' or 'other' for the student's father's job
reason close to 'home,' school 'reputation,' 'course' preference, or 'other' for the choice of school
guardian mother/father/other as the student's guardian
traveltime 1 (<15mins) / 2 (15 - 30 mins) / 3 (30 mins - 1 hr) / 4 (>1hr) for a time from home to school
studytime 1 (<2hrs) / 2 (2 - 5hrs) / 3 (5 - 10hrs) / 4 (>10hrs) for weekly study time
failures 1-3/4 for the number of class failures (if more than three, then record 4)
schoolsup yes/no for extra educational support
famsup yes/no for family educational support
paid yes/no for extra paid classes for Math or Portuguese
activities yes/no for extra-curricular activities
nursery yes/no for whether attended nursery school
higher yes/no for the desire to continue studies
internet yes/no for internet access at home
romantic yes/no for relationship status
famrel 1-5 scale on quality of family relationships
freetime 1-5 scale on how much free time after school
goout 1-5 scale on how much student goes out with friends
Dalc 1-5 scale on how much alcohol consumed on weekdays
Walc 1-5 scale on how much alcohol consumed on the weekend
health 1-5 scale on health condition
absences 0-93 number of absences from school
G1 0-20 for the first-period grade
G2 0-20 for the second-period grade
G3 0-20 for the final grade

Task 1: Sign up and create an account on Akkio.

  1. Sign up for Akkio.

  2. Open the link, Akkio, and then click the 'Try for free' button at the top right corner.

21.jpg

  1. You will see the 'Sign up' page. You may continue with an existing Google account or create a new one.

22.jpg

  1. After creating your account, you will get a pop-up window as 'How are you planning to use Akkio?', you can choose the relevant option and click 'Continue'. You can skip the rest of the pop-up windows, as it's optional. Once the setup is completed, you will get a pop-up window as 'Enjoy Your Free Trial! 🎉'.Click on 'Get Started'.

23.jpg

24.jpg

  1. The Launching page will occur; you have to select the 'Home' button from the left top corner. It will launch on the home page.

25.jpg

Task 1.1: Connecting to the dataset

  1. From the home page, click 'Create New Project' to create a new project from the existing dataset, the retail sales data dataset, one of the sample datasets provided by Akkio.

26.jpg

  1. From the Prepare tab, select the 'Upload File' option, which will redirect to the page to choose the dataset. Select the Retail sales data.csv dataset.

27.jpg

28.jpg

Task 1.2: Generating visuals using Akkio

  1. The selected dataset will appear on the page. Select the 'Explore' tab to get an exploratory insight into the relationship between marketing spend and sales by generating a scatter plot. To do so, type 'Make a scatter plot of Marketing spend vs. sales' in the 'Ask a question about your data' prompt and click the 'Execute' icon.

29.jpg

30.jpg

  1. The scatter plot will be generated. You can get the details on the approach used to create this chart by clicking the 'Show Approach'.

31.jpg

32.jpg

  1. To generate a bar chart that shows the average sales by area, type 'Create a bar chart that shows the average sales by area' in the 'Ask a question about your data' prompt and click 'Execute' icon. You can also download the charts by clicking the 'Download' button.

33.jpg

34.jpg

  1. To generate the correlation matrix on the data attributes as a heat map to understand their correlation, type 'Generate the Correlation matrix on the data attributes as heatmap' in the 'Ask a question about your data' prompt and click the 'Execute' icon.

35.jpg

36.jpg

  1. To generate box plots for verifying outliers, type 'Generate box plots to verify any outliers' in the 'Ask a question about your data' prompt and click the 'Execute' icon.

37.jpg

  1. To generate a histogram for all the attributes, type 'generate a histogram for all the attributes' in the 'Ask a question about your data' prompt and click the 'Execute' icon. You can scroll up and down to see the histograms for all the attributes.

38.jpg


Task 2 (Optional): Sign up and create an account on Columns AI

  1. Sign up for Columns AI.

  2. Open the link Columns AI and then click the 'Login' button at the top right corner.

1.jpg

  1. You will see the 'Sign in or Sign up' page. You may continue with an existing Google or Slack account or create a new one by signing up.
2.jpg
  1. After creating your account, you may launch to the main page.

3.jpg

Task 2.1: Connecting to the dataset

  1. Click the 'Story' that is shown in the top right corner. A pop-up window will appear as 'How do you provide data'.

4.jpg

  1. Select the 'Saved Data' option from the pop-up window. A pop-up window as 'Load a Dataset' will appear.
5.jpg
  1. Select the 'Connect new data' option from the pop-up window.
6.jpg
  1. Select the 'Upload a file (csv)' from the Connect your data window. Choose the 'student-mat.csv' file from your computer.
7.jpg

8.jpg

  1. Once the CSV is added, click 'Upload' from the 'Connect your data' window.
9.jpg
  1. Once you have uploaded, you can view the data. Then, click on 'Save'.

10.jpg

  1. Once the data is uploaded, you can explore the data by clicking the 'Explore' option from the Data & Query section.

11.jpg

  1. Select the 'Column Histogram' drop-down and choose any of the columns to view the visualization of autogenerated charts and statistics from the data.
12.jpg

Task 2.2: Generating Visuals using Columns AI

  1. To find the total number of male and female students in the dataset. Type "total number of male and female students in the dataset" in the 'Question' prompt and click the 'Search' button. A bar chart will appear with the sorted result. You can click 'Apply' to view and use it for the dataset.
13.jpg 14.jpg
  1. You can use the 'wizard' option from the 'Data & Query' section to generate a chart. You can generate a pie chart representing the average weekly alcohol consumption, identified by the Walc value for each gender. Click 'Make'.

15.jpg

  1. Click 'Generate' and then select Smart Title; a title is generated for the chart.
16.jpg
  1. Click 'Generate' and then select 'Summarize Insight' to generate insight on this chart. You can edit the annotated insight if you want to.
17.jpg

18.jpg

  1. You can also change the chart appearance by clicking the 'General Setting' icon and choosing any 'Theme'.

19.jpg

  1. Once done with the customizations, you can download it either as a PNG or SVG image file or as a CSV or JSON data file by clicking the download icon on the top right corner, choosing the required file type from the list, and selecting the 'Download' option.
20.jpg

Conclusion

In this lab, you learned how to use the Columns AI and Akkio platforms to generate various visuals from datasets. You connected to datasets, generated visuals using natural language prompts, modified chart color themes, and created different types of charts to analyze the data effectively. By leveraging these generative AI tools, you can streamline your data analysis process and gain insights quickly and efficiently.

Author:

Sathya Priya

cognitiveclass.ai logo